/*
 * @Author: hzxOnlineOk
 * @Date: 2025-08-20 22:03:19
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-08-20 22:13:43
 * @Description: 请填写简介
 */
#ifndef RISCV_H
#define RISCV_H
#include "types.h"

#define RISCV_REGS_SIZE 32    // riscv寄存器的数量

typedef struct _riscv_t
{
    riscv_word_t regs[RISCV_REGS_SIZE];    // 32个寄存器
    riscv_word_t pc;                       //当前的pc
} riscv_t;

#define riscv_read_reg(riscv, reg)       (riscv->regs[reg])
#define riscv_write_reg(riscv, reg, val) (if (reg) riscv->regs[reg] = val;)

riscv_t *riscv_create(void);
#endif
